import threading
import time
import random

n = 0

lock = threading.Lock()

def task():
    global n
    for i in range(10000000):
        lock.acquire()
        n += 1
        lock.release()
    print("task1中的值是:", n)


def task2():
    global n
    for i in range(10000000):
        lock.acquire()
        n += 1
        lock.release()

    print("task2中的值是:", n)


if __name__ == '__main__':
    t1 = threading.Thread(target=task)
    t2 = threading.Thread(target=task2)

    t1.start()
    t2.start()

    t1.join()
    t2.join()

    print('main 线程结束, n=', n)

    print(188*20/60/24)

    list1 = [0] * 10
    print(list1)
